package com.zhl.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.zhl.model.User;

public interface UserMapper {
	
	
	@Insert("insert into `users` (name, age) values (#{name}, #{age})")
	int insert(User user);

	@Select("select * from `users` ")
	List<User> findAll();
	
	@Select("select * from `users` where name = #{name}")
	User findByName( String name);
	
	@Update("Update `users` set name = #{name}, age = #{age} where name = #{name}")
	int update(User user);
	
	@Delete("delete from `users` where name = #{name}")
	int delete(String name);


	
}
